package messengerclient;

import java.net.*;
import java.io.*;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Set;



//TODO: make some threads daemons

class Listener extends Thread
{
    ServerSocket slot;
    public Listener(ServerSocket _slot)
    {
        slot = _slot;
    }
    public void run()
    {
        try
        {
            while (!slot.isClosed())
            {
                Socket socket = slot.accept();
                Server.instance().newConnection(socket);
            }
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
    }
}

